#ifndef PROXY_LOAD_CONFIGU_INSTANCE_H_
#define PROXY_LOAD_CONFIGU_INSTANCE_H_

#include <string>

namespace proxy{


  class ConfigInstance{
  public:
    static ConfigInstance* GetConfigInstance();
  private:
    ConfigInstance();
    virtual ~ConfigInstance();
  public:
    bool InitConfigWithFile(const std::string path_name);
    bool InitConfigWithData(const std::string json_data);

    int ping_timeout(){ return ping_timeout_; }

    const std::string bind_addr(){ return bind_addr_; }
    unsigned int bind_port(){ return bind_port_; }
    const std::string proxy_addr() { return proxy_addr_; }
    unsigned int proxy_port(){ return proxy_port_; }

    int thread_num(){ return thread_num_; }
    const std::string host_url() const { return host_url_; }
    const std::string ping_url() const { return ping_url_; }
  private:
    static ConfigInstance* instance_;

    int ping_timeout_;

    std::string bind_addr_;
    unsigned int bind_port_;

    std::string proxy_addr_;
    unsigned int proxy_port_;

    // Other setting
    int thread_num_;

    std::string host_url_;
    std::string ping_url_;
  };

}

#endif // PROXY_LOAD_CONFIGU_INSTANCE_H_